package com.example.zhongcao.mapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PicsMapper {

    @Insert("insert into pics(path,zhongcaoid) values(#{path},#{zhongcaoid})")
    void insertPic(String path,Integer zhongcaoid);

    @Select("select path from pics where zhongcaoid=#{zhongcaoid} LIMIT 1")
    String selectOnePicByid(Integer zhongcaoid);

    @Select("select path from pics where zhongcaoid=#{zhongcaoid}")
    List<String> selectAllPicsByid(Integer zhongcaoid);

    @Delete("delete from pics where zhongcaoid=#{zhongcaoid}")
    void deleteAllPics(Integer zhongcaoid);
}
